import 'package:bruno/bruno.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';


import '../../AppConfig/Config.dart';
import '../../AppConfig/RouteAct.dart';
import '../../l10n/messages.dart';
import '../ProtocolDisplay.dart';
import '../ServiceHall/FeedbackProgressDetails.dart';

class PlatformRules extends StatefulWidget {
  const PlatformRules({super.key});

  @override
  State<PlatformRules> createState() => _PlatformRulesState();
}

class _PlatformRulesState extends State<PlatformRules> {
  int isCheck=0;
  List titleList =["速配货用户服务协议","速配货平台订金担保规则","速配货平台用户违规行为处理规则","速配货平台货物运输交易规则"];
  List idList=['1805855164751679489',"1805853468734525442","1805854433457999874","1805854147259666433"];
  @override
  Widget build(BuildContext context) {
    var messages = AppLocalizations.of(context)!;
    final screenSize = MediaQuery.of(context).size;
    return Scaffold(
      backgroundColor: MyColors.backgreyColor,
      appBar: AppBar(
        leading: IconButton(icon: Icon(Icons.arrow_back_ios,color: Colors.black,),onPressed: (){Navigator.pop(context);},),
        backgroundColor: Colors.white,
        centerTitle: true,
        title: Text(messages["平台规则"],style: TextStyle(color: Colors.black,fontWeight: FontWeight.w300,fontSize: 16.sp),),
      ),
      body: ListView(
        children: [
          SizedBox(height: 8.h,),
          // Row(
          //   mainAxisAlignment: MainAxisAlignment.center,
          //   children: [
          //     GestureDetector(
          //       child:      Container(
          //         height: 30.h,
          //         width: 80.w,
          //         decoration: BoxDecoration(
          //           color: isCheck==0?MyColors.themeColor:Colors.white,
          //           borderRadius: BorderRadius.only( topLeft: Radius.circular(10),bottomLeft: Radius.circular(10)),
          //           border: Border.all(
          //             color: MyColors.themeColor, // 边框颜色
          //             width: 1.0, // 边框宽度
          //           ),
          //         ),
          //         child: Center(
          //           child: Text("规则中心",style: TextStyle(fontSize: 12.sp,color: isCheck==0?Colors.white:MyColors.themeColor),),
          //         ),
          //       ),
          //       onTap: (){
          //         setState(() {
          //           isCheck=0;
          //         });
          //       },
          //     ),
          //     GestureDetector(
          //       child:      Container(
          //         height: 30.h,
          //         width: 80.w,
          //         decoration: BoxDecoration(
          //           color: isCheck==1?MyColors.themeColor:Colors.white,
          //           borderRadius: BorderRadius.only( topRight: Radius.circular(10),bottomRight: Radius.circular(10)),
          //           border: Border.all(
          //             color: MyColors.themeColor, // 边框颜色
          //             width: 1.0, // 边框宽度
          //           ),
          //         ),
          //         child: Center(
          //           child: Text("公告通知",style: TextStyle(fontSize: 12.sp,color: isCheck==1?Colors.white:MyColors.themeColor),),
          //         ),
          //       ),
          //       onTap: (){
          //         setState(() {
          //           isCheck=1;
          //         });
          //       },
          //     ),
          //   ],
          // ),
          //
          // SizedBox(height: 10.h,),
          Container(
            height: titleList.length *40.h ,
            child: ListView.builder(
                itemCount: titleList.length,
                itemBuilder: (BuildContext context, int index) {
                  return GestureDetector(
                    child:   Column(
                      children: [
                        Container(
                          padding: EdgeInsets.only(left: 10.w,right: 10.w,top: 8.h,bottom: 8.h),
                          color: Colors.white,
                          child:  Row(
                            mainAxisAlignment: MainAxisAlignment.spaceBetween,
                            children: [
                              Text(titleList[index],style: TextStyle(color: Colors.black,fontSize: 14.sp),),
                              Icon(Icons.arrow_forward_ios,color: MyColors.authTipColor,size: 14,),
                            ],
                          ),
                        ),

                        Container(
                          height: 1.h,

                        )
                      ],
                    ),
                    onTap: (){
                      Navigator.push(context, FadeRoute(
                          page: ProtocolDisplay(id: idList[index],)));
                    },
                  )
                  ;


                }
            ),
          )
        ],
      ),
    );
  }
}
